package db

const TableNameChamber = TablePrefix + "chamber"

type Chamber struct {
	BaseModel
	UID  uint   `gorm:"column:uid;type:int(11);default:0;comment:用户id" json:"uid" form:"uid"`          // 用户id
	Name string `gorm:"column:name;type:varchar(100);default:'';comment:工会名称" json:"name" form:"name"` // 工会名称
	Desc string `gorm:"column:desc;type:varchar(255);comment:工会简介" json:"desc" form:"desc"`            // 工会简介
}

func (*Chamber) TableName() string {
	return TableNameChamber
}

type ChamberHasManyMemberAsUser struct {
	Chamber
	Members []ChamberMemberHasOneLevelAsUser `gorm:"foreignKey:ChamberID;references:ID" json:"members"`
	User    UserHasOneRole                   `gorm:"foreignKey:ID;references:UID" json:"user"`
}
